package com.implementsystem.prestacontas.programas.session;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import com.implementsystem.prestacontas.geral.session.GenericSession;
import com.implementsystem.prestacontas.programas.dao.ProgramaDao;
import com.implementsystem.prestacontas.programas.entity.Programa;

@Stateless
public class ProgramaSession extends GenericSession<Programa>{

	private static final long serialVersionUID = 5108782899003359958L;

	@EJB
	private ProgramaDao dao;
	
	public List<Programa> findAllOrderByDescricao(){
		return dao.findAllOrderByDescricao();
	}
	
	public Boolean findByCodigoPrograma(String codigo){
		
		Programa programa = dao.findByCodigoPrograma(codigo);
		
		if(programa != null && programa.getId() != null)
			return true;
		else
			return false;
		
	}
		

}
